//
//  DetaileJobCell.m
//  HubeiHotel
//
//  Created by LiBenCan on 17/11/20.
//  Copyright © 2017年 张露杰. All rights reserved.
//

#import "DetaileJobCell.h"

@implementation DetaileJobCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    //    继承父类
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
    }
    return self;
}
-(void)loadCellWithData:(NSDictionary *)dataDic
{
    //    重新布局
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    //职位
    _titleLabel = [UILabel new];
    _titleLabel.textColor = TextBlack;
    _titleLabel.font = [UIFont systemFontOfSize:17];
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(16*screenW_6));
        make.top.equalTo(@(16*screenW_6));
        make.height.equalTo(@(20));
        make.width.equalTo(@(SCREENW-120*screenW_6));
    }];
    
    //工资
    _moneyLabel = [UILabel new];
    _moneyLabel.textColor = [UIColor colorWithHexString:@"#fe6905"];
    _moneyLabel.font = [UIFont systemFontOfSize:17];
    [self.contentView addSubview:_moneyLabel];
    [_moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel.mas_right).offset(10*screenW_6);
        make.right.equalTo(self.contentView).offset(-10*screenW_6);
        make.top.equalTo(@(16*screenW_6));
        make.height.equalTo(@(20));
    }];
    
    //种类
    _adressLabel =  [UILabel new];
    _adressLabel.textColor = TextBlackGray;
    _adressLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:_adressLabel];
    [_adressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel.mas_left);
        make.top.equalTo(_titleLabel.mas_bottom).offset(10*screenW_6);
        make.height.equalTo(@(20));
        make.width.equalTo(@(SCREENW-120*screenW_6));
    }];
    

    //时间
    _timeLabel = [UILabel new];
    _timeLabel.textColor = TextBlackGray;
    _timeLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:_timeLabel];
    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_adressLabel.mas_right).offset(10*screenW_6);
        make.right.equalTo(self.contentView).offset(-10*screenW_6);
        make.top.equalTo(_titleLabel.mas_bottom).offset(10*screenW_6);
        make.height.equalTo(@(20));
    }];
    
    //画线
    _lineLab = [UILabel new];
    _lineLab.backgroundColor = LineColor;
    _lineLab.text = @" ";
    [self.contentView  addSubview:_lineLab];
    [_lineLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.right.equalTo(@0);
        make.height.equalTo(@1);
        make.top.equalTo(_adressLabel.mas_bottom).offset(15*screenW_6);
        make.bottom.equalTo(self.contentView).offset(0);
    }];

    _titleLabel.text = dataDic[@"name"];
    _moneyLabel.text = dataDic[@"salary"];
    _adressLabel.text = [NSString stringWithFormat:@"%@ ｜ %@ ｜ %@",dataDic[@"areaName"],dataDic[@"workingLife"],dataDic[@"education"]];
    _timeLabel.text = [TomamaUI dateTostiring:[TomamaUI getDateWithStringNo8:dataDic[@"createDate"]] andString:@"MM月dd日"];
}

@end
